/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class DeleteEvaluacionDocenteData {
	public void deleteTestData() throws PersistentException {
		PersistentTransaction t = orm.EvaluacionDocentePersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.EvaluacionDAO lormEvaluacionDAO = lDAOFactory.getEvaluacionDAO();
			orm.Evaluacion lormEvaluacion = lormEvaluacionDAO.loadEvaluacionByQuery(null, null);
			// Delete the persistent object
			lormEvaluacionDAO.delete(lormEvaluacion);
			orm.dao.RegionDAO lormRegionDAO = lDAOFactory.getRegionDAO();
			orm.Region lormRegion = lormRegionDAO.loadRegionByQuery(null, null);
			// Delete the persistent object
			lormRegionDAO.delete(lormRegion);
			orm.dao.ComunaDAO lormComunaDAO = lDAOFactory.getComunaDAO();
			orm.Comuna lormComuna = lormComunaDAO.loadComunaByQuery(null, null);
			// Delete the persistent object
			lormComunaDAO.delete(lormComuna);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			DeleteEvaluacionDocenteData deleteEvaluacionDocenteData = new DeleteEvaluacionDocenteData();
			try {
				deleteEvaluacionDocenteData.deleteTestData();
			}
			finally {
				orm.EvaluacionDocentePersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
